// 包名与模块引入
package com.example.coffee.mock;
import com.example.coffee.ResourceTable;
import com.example.coffee.items.CaffeeItem;
import com.example.coffee.items.IndexBarItem;
import com.example.coffee.items.OrderItem;
import com.example.coffee.items.StoreItem;

import java.util.ArrayList;
import java.util.List;
// 类实现
public class DataMockManager {
    // 餐品类别列表数据
    static private String[] indexBarData = {
            "好评爆款",  "美式家族", "古典茶饮", "咖啡牛奶",
            "活力果汁",  "畅爽沙冰", "大师甄选", "今日特惠",
            "瑞纳冰", "雪顶咖啡", "塑身无糖", "经典咖啡",
            "新品试喝", "即将上线"
    };
    // 生成餐品类别列表数据模型模拟数据
    static public List<IndexBarItem> mockIndexBarData() {
        List<IndexBarItem> list = new ArrayList<>();
        for (String indexBarDatum : indexBarData) {
            list.add(new IndexBarItem(indexBarDatum));
        }
        return list;
    }
    // 生成餐品列表数据模型模拟数据
    static public List<CaffeeItem> mockCaffeeList(String category) {
        List<CaffeeItem> list = new ArrayList<>();
        for (int i = 'A'; i <= 'Z'; i++) {
            list.add(new CaffeeItem(ResourceTable.Media_coffee, category + String.format("-%c款", i), "18.8￥", "低糖|超好喝", "27.9￥"));
        }
        return list;
    }
    // 生成门店列表数据模型模拟数据
    static  public  List<StoreItem> mockStoreList() {
        List<StoreItem> list = new ArrayList<>();
        for (int i = 'A'; i <= 'Z'; i++) {
            list.add(new StoreItem("中山路门店" + String.format("%c", i), "距离300m", "⌚️：早晨8:00~下午5:30", "📌：中山路南门168号"));
        }
        return list;
    }
    // 生成搜索列表模拟数据
    static public List<CaffeeItem> mockSearchResultList(String keywrod) {
        List<CaffeeItem> list = new ArrayList<>();
        for (int i = 'A'; i <= 'Z'; i++) {
            list.add(new CaffeeItem(ResourceTable.Media_coffee, keywrod + String.format("-%c款", i), "18.8￥", "低糖|超好喝", "27.9￥"));
        }
        return list;
    }
    // 生成订单信息模拟数据
    static public OrderItem mockOrderDetail(String orderId) {
        return new OrderItem(new CaffeeItem(ResourceTable.Media_coffee, "咖啡A", "9.9￥", "低糖|超好喝", "27.9￥"), "9.9￥", orderId, "商家已接单", "2023-05-07 12:00:00", "131********");
    }
}
